#ifndef __NI_CONVERTER__
#define __NI_CONVERTER__

#include "opencv2/opencv.hpp"

struct WorldConversionCache
{
	float xzFactor;
	float yzFactor;
	float coeffX;
	float coeffY;
	int resolutionX;
	int resolutionY;
	int halfResX;
	int halfResY;
};

class NIConverter
{
public:
	NIConverter(void);
	~NIConverter(void);

	WorldConversionCache m_world_DepthCache;
	WorldConversionCache m_world_ColorCache;

	void refreshConvertCache();
	void convertDepthToWorldCoordinates(float depthX, float depthY, float depthZ, float* pWorldX, float* pWorldY, float* pWorldZ);
	void convertWorldToDepthCoordinates(float worldX, float worldY, float worldZ, float* pDepthX, float* pDepthY, float* pDepthZ);

	void convertWorldToColorCoordinates(float worldX, float worldY, float worldZ, float* pColorX, float* pColorY);
	void convertDepthToColorCoordinates(float depthX, float depthY, float depthZ, int* pColorX, int* pColorY);
};

#endif __NI_CONVERTER__